package 多线程.线程状态.RUNNABLE;

public class Main {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(()->{
            for(int i = 0;i < 5;i++){
                System.out.println(i);
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        t1.start();
        // 在启动线程后，线程的状态可能是 RUNNABLE
        System.out.println("Thread state after start: " + t1.getState());
        t1.join();

        System.out.println(t1.getState());
    }
}
